<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>删除节点-应用实例</title>
  <script type="text/javascript" src="../script/jquery-3.6.0.min.js"></script>
  <script type="text/javascript">
    $(function () {
      $("#b1").click(function () {
        $("p").remove()
      })

      $("#b2").click(function () {
        $("p").empty()
      })

      $("#b3").click(function () {
        $("#sh").remove()
      })
    })
  </script>
</head>
<body>
您喜欢的城市:<br>
<ul id="city">
  <li id="bj" name="beijing">北京</li>
  <li id="sh" name="shanghai">上海</li>
  <li id="tj" name="tianjin">天津</li>
</ul>
您爱好的游戏:<br>
<ul id="game">
  <li id="fk" name="fakong">反恐</li>
  <li id="cq" name="chuangqi">传奇</li>
</ul>
<p>Hello</p> how are <p>you?</p>
<p name="test">Hello, <span>Person</span> <a href="#">and person</a></p>
<input type="button" value="删除所有 p" id="b1"/>
<input type="button" value="所有 p 清空" id="b2"/>
<input type="button" value="删除上海这个 li" id="b3"/>
</body>
</html>